﻿
/*----------------------------------------------------------------//
// 文件名：MoClientInfo.cs
// 文件功能描述：实体 MoClientInfo.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoClientInfo
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoClientInfo
    /// </summary>
    public partial class MoClientInfo : ICloneable
    {
        #region 表ClientInfo的字段
        private string clientId;
        private string corpName;
        private string consigner;
        private string linkman;
        private string tel;
        private string phone;
        private string fax;
        private string addr;
        private string postcode;
        private string email;
        private string pwd;
        private DateTime createTime;
        private DateTime updateTime;
        #endregion

        #region 构造函数
        public MoClientInfo()
        {
            createTime = new DateTime(1900, 1, 1); updateTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoClientInfo(MoClientInfo item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoClientInfo(string clientId, string corpName, string consigner, string linkman, string tel, string phone, string fax, string addr, string postcode, string email, string pwd, DateTime createTime, DateTime updateTime)
        {
            this.clientId = clientId;
            this.corpName = corpName;
            this.consigner = consigner;
            this.linkman = linkman;
            this.tel = tel;
            this.phone = phone;
            this.fax = fax;
            this.addr = addr;
            this.postcode = postcode;
            this.email = email;
            this.pwd = pwd;
            this.createTime = createTime;
            this.updateTime = updateTime;
        }
        #endregion

        #region 表ClientInfo的字段属性
        /// <summary>
        ///客户ID应符合一定的规则。
        /// </summary>
        public string ClientId
        {
            get { return clientId; }
            set { clientId = value; }
        }
        /// <summary>
        /// CORP_NAME
        /// </summary>
        public string CorpName
        {
            get { return corpName; }
            set { corpName = value; }
        }
        /// <summary>
        /// CONSIGNER
        /// </summary>
        public string Consigner
        {
            get { return consigner; }
            set { consigner = value; }
        }
        /// <summary>
        /// LINKMAN
        /// </summary>
        public string Linkman
        {
            get { return linkman; }
            set { linkman = value; }
        }
        /// <summary>
        /// TEL
        /// </summary>
        public string Tel
        {
            get { return tel; }
            set { tel = value; }
        }
        /// <summary>
        /// PHONE
        /// </summary>
        public string Phone
        {
            get { return phone; }
            set { phone = value; }
        }
        /// <summary>
        /// FAX
        /// </summary>
        public string Fax
        {
            get { return fax; }
            set { fax = value; }
        }
        /// <summary>
        /// ADDR
        /// </summary>
        public string Addr
        {
            get { return addr; }
            set { addr = value; }
        }
        /// <summary>
        /// POSTCODE
        /// </summary>
        public string Postcode
        {
            get { return postcode; }
            set { postcode = value; }
        }
        /// <summary>
        /// EMAIL
        /// </summary>
        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        /// <summary>
        /// PWD
        /// </summary>
        public string Pwd
        {
            get { return pwd; }
            set { pwd = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        /// <summary>
        /// UPDATE_TIME
        /// </summary>
        public DateTime UpdateTime
        {
            get { return updateTime; }
            set { updateTime = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoClientInfo CopyTo(MoClientInfo item)
        {
            item.clientId = this.clientId;
            item.corpName = this.corpName;
            item.consigner = this.consigner;
            item.linkman = this.linkman;
            item.tel = this.tel;
            item.phone = this.phone;
            item.fax = this.fax;
            item.addr = this.addr;
            item.postcode = this.postcode;
            item.email = this.email;
            item.pwd = this.pwd;
            item.createTime = this.createTime;
            item.updateTime = this.updateTime;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoClientInfo mo = new MoClientInfo();
            mo.ClientId = this.ClientId;
            mo.CorpName = this.CorpName;
            mo.Consigner = this.Consigner;
            mo.Linkman = this.Linkman;
            mo.Tel = this.Tel;
            mo.Phone = this.Phone;
            mo.Fax = this.Fax;
            mo.Addr = this.Addr;
            mo.Postcode = this.Postcode;
            mo.Email = this.Email;
            mo.Pwd = this.Pwd;
            mo.CreateTime = this.CreateTime;
            mo.UpdateTime = this.UpdateTime;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoClientInfo NewClientInfo = obj as MoClientInfo;
                if (NewClientInfo == null)
                {
                    return false;
                }
                else
                {
                    if (NewClientInfo.ClientId == this.ClientId && NewClientInfo.CorpName == this.CorpName && NewClientInfo.Consigner == this.Consigner && NewClientInfo.Linkman == this.Linkman && NewClientInfo.Tel == this.Tel && NewClientInfo.Phone == this.Phone && NewClientInfo.Fax == this.Fax && NewClientInfo.Addr == this.Addr && NewClientInfo.Postcode == this.Postcode && NewClientInfo.Email == this.Email && NewClientInfo.Pwd == this.Pwd && NewClientInfo.CreateTime == this.CreateTime && NewClientInfo.UpdateTime == this.UpdateTime)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "ClientId={0}/CorpName={1}/Consigner={2}/Linkman={3}/Tel={4}/Phone={5}/Fax={6}/Addr={7}/Postcode={8}/Email={9}/Pwd={10}/CreateTime={11}/UpdateTime={12}", clientId, corpName, consigner, linkman, tel, phone, fax, addr, postcode, email, pwd, createTime, updateTime);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Client_ID"] != null && row["Client_ID"] != DBNull.Value)
            {
                this.ClientId = (string)row["Client_ID"];
            }
            else
            {
                this.ClientId = string.Empty;
            }
            if (row["Corp_Name"] != null && row["Corp_Name"] != DBNull.Value)
            {
                this.CorpName = (string)row["Corp_Name"];
            }
            else
            {
                this.CorpName = string.Empty;
            }
            if (row["Consigner"] != null && row["Consigner"] != DBNull.Value)
            {
                this.Consigner = (string)row["Consigner"];
            }
            else
            {
                this.Consigner = string.Empty;
            }
            if (row["Linkman"] != null && row["Linkman"] != DBNull.Value)
            {
                this.Linkman = (string)row["Linkman"];
            }
            else
            {
                this.Linkman = string.Empty;
            }
            if (row["Tel"] != null && row["Tel"] != DBNull.Value)
            {
                this.Tel = (string)row["Tel"];
            }
            else
            {
                this.Tel = string.Empty;
            }
            if (row["Phone"] != null && row["Phone"] != DBNull.Value)
            {
                this.Phone = (string)row["Phone"];
            }
            else
            {
                this.Phone = string.Empty;
            }
            if (row["Fax"] != null && row["Fax"] != DBNull.Value)
            {
                this.Fax = (string)row["Fax"];
            }
            else
            {
                this.Fax = string.Empty;
            }
            if (row["Addr"] != null && row["Addr"] != DBNull.Value)
            {
                this.Addr = (string)row["Addr"];
            }
            else
            {
                this.Addr = string.Empty;
            }
            if (row["Postcode"] != null && row["Postcode"] != DBNull.Value)
            {
                this.Postcode = (string)row["Postcode"];
            }
            else
            {
                this.Postcode = string.Empty;
            }
            if (row["email"] != null && row["email"] != DBNull.Value)
            {
                this.Email = (string)row["email"];
            }
            else
            {
                this.Email = string.Empty;
            }
            if (row["PWD"] != null && row["PWD"] != DBNull.Value)
            {
                this.Pwd = (string)row["PWD"];
            }
            else
            {
                this.Pwd = string.Empty;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
            if (row["Update_Time"] != null && row["Update_Time"] != DBNull.Value)
            {
                this.UpdateTime = (DateTime)row["Update_Time"];
            }
            else
            {
                this.UpdateTime = DateTime.MinValue;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Client_ID"] = this.ClientId;
            row["Corp_Name"] = this.CorpName;
            row["Consigner"] = this.Consigner;
            row["Linkman"] = this.Linkman;
            row["Tel"] = this.Tel;
            row["Phone"] = this.Phone;
            row["Fax"] = this.Fax;
            row["Addr"] = this.Addr;
            row["Postcode"] = this.Postcode;
            row["email"] = this.Email;
            row["PWD"] = this.Pwd;
            row["Create_Time"] = this.CreateTime;
            row["Update_Time"] = this.UpdateTime;
        }
        #endregion
    }
}
#endregion
